﻿#region License
/* ---------------------------------------------------------------- *
 *
 * This file is part of the Xcoordination Application Space
 * ("XcoAppSpace") http://www.xcoordination.com
 *
 * Copyright (C) 2009 Xcoordination http://www.xcoordination.com
 *
 * XcoAppSpace is free software; you can redistribute it and/or
 * modify it under the terms of version 2 of the GNU General
 * Public License as published by the Free Software Foundation.
 *
 * XcoAppSpace is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see http://www.gnu.org/licenses/
 * or write to the Free Software Foundation, Inc., 51 Franklin
 * Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 * ---------------------------------------------------------------- */
#endregion

using System;
using Microsoft.Ccr.Core;

namespace XcoAppSpaces.Core
{
	/// <summary>
	/// Extensions for PortSet classes.
	/// </summary>
	public static class PortSetExtensions
	{
		#region PostWithCausality (2-5 Ports)
		/// <summary>
		/// Posts a message to the port while using the given exceptionPort as causality.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <param name="port">The port set.</param>
		/// <param name="item">The item to be posted.</param>
		/// <param name="exceptionPort">The port where exceptions should be returned.</param>
		public static void PostWithCausality<T1, T2>(this PortSet<T1, T2> port, T1 item, Port<Exception> exceptionPort)
		{
			port.P0.PostWithCausality(item, exceptionPort);
		}

		/// <summary>
		/// Posts a message to the port while using the given exceptionPort as causality.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <param name="port">The port set.</param>
		/// <param name="item">The item to be posted.</param>
		/// <param name="exceptionPort">The port where exceptions should be returned.</param>
		public static void PostWithCausality<T1, T2>(this PortSet<T1, T2> port, T2 item, Port<Exception> exceptionPort)
		{
			port.P1.PostWithCausality(item, exceptionPort);
		}

		/// <summary>
		/// Posts a message to the port while using the given exceptionPort as causality.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <typeparam name="T3">Message type of the port set.</typeparam>
		/// <param name="port">The port set.</param>
		/// <param name="item">The item to be posted.</param>
		/// <param name="exceptionPort">The port where exceptions should be returned.</param>
		public static void PostWithCausality<T1, T2, T3>(this PortSet<T1, T2, T3> port, T1 item, Port<Exception> exceptionPort)
		{
			port.P0.PostWithCausality(item, exceptionPort);
		}

		/// <summary>
		/// Posts a message to the port while using the given exceptionPort as causality.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <typeparam name="T3">Message type of the port set.</typeparam>
		/// <param name="port">The port set.</param>
		/// <param name="item">The item to be posted.</param>
		/// <param name="exceptionPort">The port where exceptions should be returned.</param>
		public static void PostWithCausality<T1, T2, T3>(this PortSet<T1, T2, T3> port, T2 item, Port<Exception> exceptionPort)
		{
			port.P1.PostWithCausality(item, exceptionPort);
		}

		/// <summary>
		/// Posts a message to the port while using the given exceptionPort as causality.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <typeparam name="T3">Message type of the port set.</typeparam>
		/// <param name="port">The port set.</param>
		/// <param name="item">The item to be posted.</param>
		/// <param name="exceptionPort">The port where exceptions should be returned.</param>
		public static void PostWithCausality<T1, T2, T3>(this PortSet<T1, T2, T3> port, T3 item, Port<Exception> exceptionPort)
		{
			port.P2.PostWithCausality(item, exceptionPort);
		}

		/// <summary>
		/// Posts a message to the port while using the given exceptionPort as causality.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <typeparam name="T3">Message type of the port set.</typeparam>
		/// <typeparam name="T4">Message type of the port set.</typeparam>
		/// <param name="port">The port set.</param>
		/// <param name="item">The item to be posted.</param>
		/// <param name="exceptionPort">The port where exceptions should be returned.</param>
		public static void PostWithCausality<T1, T2, T3, T4>(this PortSet<T1, T2, T3, T4> port, T1 item, Port<Exception> exceptionPort)
		{
			port.P0.PostWithCausality(item, exceptionPort);
		}

		/// <summary>
		/// Posts a message to the port while using the given exceptionPort as causality.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <typeparam name="T3">Message type of the port set.</typeparam>
		/// <typeparam name="T4">Message type of the port set.</typeparam>
		/// <param name="port">The port set.</param>
		/// <param name="item">The item to be posted.</param>
		/// <param name="exceptionPort">The port where exceptions should be returned.</param>
		public static void PostWithCausality<T1, T2, T3, T4>(this PortSet<T1, T2, T3, T4> port, T2 item, Port<Exception> exceptionPort)
		{
			port.P1.PostWithCausality(item, exceptionPort);
		}

		/// <summary>
		/// Posts a message to the port while using the given exceptionPort as causality.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <typeparam name="T3">Message type of the port set.</typeparam>
		/// <typeparam name="T4">Message type of the port set.</typeparam>
		/// <param name="port">The port set.</param>
		/// <param name="item">The item to be posted.</param>
		/// <param name="exceptionPort">The port where exceptions should be returned.</param>
		public static void PostWithCausality<T1, T2, T3, T4>(this PortSet<T1, T2, T3, T4> port, T3 item, Port<Exception> exceptionPort)
		{
			port.P2.PostWithCausality(item, exceptionPort);
		}

		/// <summary>
		/// Posts a message to the port while using the given exceptionPort as causality.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <typeparam name="T3">Message type of the port set.</typeparam>
		/// <typeparam name="T4">Message type of the port set.</typeparam>
		/// <param name="port">The port set.</param>
		/// <param name="item">The item to be posted.</param>
		/// <param name="exceptionPort">The port where exceptions should be returned.</param>
		public static void PostWithCausality<T1, T2, T3, T4>(this PortSet<T1, T2, T3, T4> port, T4 item, Port<Exception> exceptionPort)
		{
			port.P3.PostWithCausality(item, exceptionPort);
		}

		/// <summary>
		/// Posts a message to the port while using the given exceptionPort as causality.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <typeparam name="T3">Message type of the port set.</typeparam>
		/// <typeparam name="T4">Message type of the port set.</typeparam>
		/// <typeparam name="T5">Message type of the port set.</typeparam>
		/// <param name="port">The port set.</param>
		/// <param name="item">The item to be posted.</param>
		/// <param name="exceptionPort">The port where exceptions should be returned.</param>
		public static void PostWithCausality<T1, T2, T3, T4, T5>(this PortSet<T1, T2, T3, T4, T5> port, T1 item, Port<Exception> exceptionPort)
		{
			port.P0.PostWithCausality(item, exceptionPort);
		}

		/// <summary>
		/// Posts a message to the port while using the given exceptionPort as causality.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <typeparam name="T3">Message type of the port set.</typeparam>
		/// <typeparam name="T4">Message type of the port set.</typeparam>
		/// <typeparam name="T5">Message type of the port set.</typeparam>
		/// <param name="port">The port set.</param>
		/// <param name="item">The item to be posted.</param>
		/// <param name="exceptionPort">The port where exceptions should be returned.</param>
		public static void PostWithCausality<T1, T2, T3, T4, T5>(this PortSet<T1, T2, T3, T4, T5> port, T2 item, Port<Exception> exceptionPort)
		{
			port.P1.PostWithCausality(item, exceptionPort);
		}

		/// <summary>
		/// Posts a message to the port while using the given exceptionPort as causality.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <typeparam name="T3">Message type of the port set.</typeparam>
		/// <typeparam name="T4">Message type of the port set.</typeparam>
		/// <typeparam name="T5">Message type of the port set.</typeparam>
		/// <param name="port">The port set.</param>
		/// <param name="item">The item to be posted.</param>
		/// <param name="exceptionPort">The port where exceptions should be returned.</param>
		public static void PostWithCausality<T1, T2, T3, T4, T5>(this PortSet<T1, T2, T3, T4, T5> port, T3 item, Port<Exception> exceptionPort)
		{
			port.P2.PostWithCausality(item, exceptionPort);
		}

		/// <summary>
		/// Posts a message to the port while using the given exceptionPort as causality.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <typeparam name="T3">Message type of the port set.</typeparam>
		/// <typeparam name="T4">Message type of the port set.</typeparam>
		/// <typeparam name="T5">Message type of the port set.</typeparam>
		/// <param name="port">The port set.</param>
		/// <param name="item">The item to be posted.</param>
		/// <param name="exceptionPort">The port where exceptions should be returned.</param>
		public static void PostWithCausality<T1, T2, T3, T4, T5>(this PortSet<T1, T2, T3, T4, T5> port, T4 item, Port<Exception> exceptionPort)
		{
			port.P3.PostWithCausality(item, exceptionPort);
		}

		/// <summary>
		/// Posts a message to the port while using the given exceptionPort as causality.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <typeparam name="T3">Message type of the port set.</typeparam>
		/// <typeparam name="T4">Message type of the port set.</typeparam>
		/// <typeparam name="T5">Message type of the port set.</typeparam>
		/// <param name="port">The port set.</param>
		/// <param name="item">The item to be posted.</param>
		/// <param name="exceptionPort">The port where exceptions should be returned.</param>
		public static void PostWithCausality<T1, T2, T3, T4, T5>(this PortSet<T1, T2, T3, T4, T5> port, T5 item, Port<Exception> exceptionPort)
		{
			port.P4.PostWithCausality(item, exceptionPort);
		}

		#endregion

		#region PostWithCausality +CoordinationPort (2-5 Ports)
		/// <summary>
		/// Posts a message to the port while using the given exceptionPort as causality.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <param name="port">The port set.</param>
		/// <param name="item">The item to be posted.</param>
		/// <param name="exceptionPort">The port where exceptions should be returned.</param>
		/// <param name="coordinationPort">Port that can be used for coordination. If a Port&lt;Ack&gt; is used, an Ack is posted there when the message has been transferred successfully.</param>
		public static void PostWithCausality<T1, T2>(this PortSet<T1, T2> port, T1 item, Port<Exception> exceptionPort, IPort coordinationPort)
		{
			port.P0.PostWithCausality(item, exceptionPort, coordinationPort);
		}

		/// <summary>
		/// Posts a message to the port while using the given exceptionPort as causality.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <param name="port">The port set.</param>
		/// <param name="item">The item to be posted.</param>
		/// <param name="exceptionPort">The port where exceptions should be returned.</param>
		/// <param name="coordinationPort">Port that can be used for coordination. If a Port&lt;Ack&gt; is used, an Ack is posted there when the message has been transferred successfully.</param>
		public static void PostWithCausality<T1, T2>(this PortSet<T1, T2> port, T2 item, Port<Exception> exceptionPort, IPort coordinationPort)
		{
			port.P1.PostWithCausality(item, exceptionPort, coordinationPort);
		}

		/// <summary>
		/// Posts a message to the port while using the given exceptionPort as causality.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <typeparam name="T3">Message type of the port set.</typeparam>
		/// <param name="port">The port set.</param>
		/// <param name="item">The item to be posted.</param>
		/// <param name="exceptionPort">The port where exceptions should be returned.</param>
		/// <param name="coordinationPort">Port that can be used for coordination. If a Port&lt;Ack&gt; is used, an Ack is posted there when the message has been transferred successfully.</param>
		public static void PostWithCausality<T1, T2, T3>(this PortSet<T1, T2, T3> port, T1 item, Port<Exception> exceptionPort, IPort coordinationPort)
		{
			port.P0.PostWithCausality(item, exceptionPort, coordinationPort);
		}

		/// <summary>
		/// Posts a message to the port while using the given exceptionPort as causality.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <typeparam name="T3">Message type of the port set.</typeparam>
		/// <param name="port">The port set.</param>
		/// <param name="item">The item to be posted.</param>
		/// <param name="exceptionPort">The port where exceptions should be returned.</param>
		/// <param name="coordinationPort">Port that can be used for coordination. If a Port&lt;Ack&gt; is used, an Ack is posted there when the message has been transferred successfully.</param>
		public static void PostWithCausality<T1, T2, T3>(this PortSet<T1, T2, T3> port, T2 item, Port<Exception> exceptionPort, IPort coordinationPort)
		{
			port.P1.PostWithCausality(item, exceptionPort, coordinationPort);
		}

		/// <summary>
		/// Posts a message to the port while using the given exceptionPort as causality.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <typeparam name="T3">Message type of the port set.</typeparam>
		/// <param name="port">The port set.</param>
		/// <param name="item">The item to be posted.</param>
		/// <param name="exceptionPort">The port where exceptions should be returned.</param>
		/// <param name="coordinationPort">Port that can be used for coordination. If a Port&lt;Ack&gt; is used, an Ack is posted there when the message has been transferred successfully.</param>
		public static void PostWithCausality<T1, T2, T3>(this PortSet<T1, T2, T3> port, T3 item, Port<Exception> exceptionPort, IPort coordinationPort)
		{
			port.P2.PostWithCausality(item, exceptionPort, coordinationPort);
		}

		/// <summary>
		/// Posts a message to the port while using the given exceptionPort as causality.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <typeparam name="T3">Message type of the port set.</typeparam>
		/// <typeparam name="T4">Message type of the port set.</typeparam>
		/// <param name="port">The port set.</param>
		/// <param name="item">The item to be posted.</param>
		/// <param name="exceptionPort">The port where exceptions should be returned.</param>
		/// <param name="coordinationPort">Port that can be used for coordination. If a Port&lt;Ack&gt; is used, an Ack is posted there when the message has been transferred successfully.</param>
		public static void PostWithCausality<T1, T2, T3, T4>(this PortSet<T1, T2, T3, T4> port, T1 item, Port<Exception> exceptionPort, IPort coordinationPort)
		{
			port.P0.PostWithCausality(item, exceptionPort, coordinationPort);
		}

		/// <summary>
		/// Posts a message to the port while using the given exceptionPort as causality.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <typeparam name="T3">Message type of the port set.</typeparam>
		/// <typeparam name="T4">Message type of the port set.</typeparam>
		/// <param name="port">The port set.</param>
		/// <param name="item">The item to be posted.</param>
		/// <param name="exceptionPort">The port where exceptions should be returned.</param>
		/// <param name="coordinationPort">Port that can be used for coordination. If a Port&lt;Ack&gt; is used, an Ack is posted there when the message has been transferred successfully.</param>
		public static void PostWithCausality<T1, T2, T3, T4>(this PortSet<T1, T2, T3, T4> port, T2 item, Port<Exception> exceptionPort, IPort coordinationPort)
		{
			port.P1.PostWithCausality(item, exceptionPort, coordinationPort);
		}

		/// <summary>
		/// Posts a message to the port while using the given exceptionPort as causality.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <typeparam name="T3">Message type of the port set.</typeparam>
		/// <typeparam name="T4">Message type of the port set.</typeparam>
		/// <param name="port">The port set.</param>
		/// <param name="item">The item to be posted.</param>
		/// <param name="exceptionPort">The port where exceptions should be returned.</param>
		/// <param name="coordinationPort">Port that can be used for coordination. If a Port&lt;Ack&gt; is used, an Ack is posted there when the message has been transferred successfully.</param>
		public static void PostWithCausality<T1, T2, T3, T4>(this PortSet<T1, T2, T3, T4> port, T3 item, Port<Exception> exceptionPort, IPort coordinationPort)
		{
			port.P2.PostWithCausality(item, exceptionPort, coordinationPort);
		}

		/// <summary>
		/// Posts a message to the port while using the given exceptionPort as causality.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <typeparam name="T3">Message type of the port set.</typeparam>
		/// <typeparam name="T4">Message type of the port set.</typeparam>
		/// <param name="port">The port set.</param>
		/// <param name="item">The item to be posted.</param>
		/// <param name="exceptionPort">The port where exceptions should be returned.</param>
		/// <param name="coordinationPort">Port that can be used for coordination. If a Port&lt;Ack&gt; is used, an Ack is posted there when the message has been transferred successfully.</param>
		public static void PostWithCausality<T1, T2, T3, T4>(this PortSet<T1, T2, T3, T4> port, T4 item, Port<Exception> exceptionPort, IPort coordinationPort)
		{
			port.P3.PostWithCausality(item, exceptionPort, coordinationPort);
		}

		/// <summary>
		/// Posts a message to the port while using the given exceptionPort as causality.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <typeparam name="T3">Message type of the port set.</typeparam>
		/// <typeparam name="T4">Message type of the port set.</typeparam>
		/// <typeparam name="T5">Message type of the port set.</typeparam>
		/// <param name="port">The port set.</param>
		/// <param name="item">The item to be posted.</param>
		/// <param name="exceptionPort">The port where exceptions should be returned.</param>
		/// <param name="coordinationPort">Port that can be used for coordination. If a Port&lt;Ack&gt; is used, an Ack is posted there when the message has been transferred successfully.</param>
		public static void PostWithCausality<T1, T2, T3, T4, T5>(this PortSet<T1, T2, T3, T4, T5> port, T1 item, Port<Exception> exceptionPort, IPort coordinationPort)
		{
			port.P0.PostWithCausality(item, exceptionPort, coordinationPort);
		}

		/// <summary>
		/// Posts a message to the port while using the given exceptionPort as causality.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <typeparam name="T3">Message type of the port set.</typeparam>
		/// <typeparam name="T4">Message type of the port set.</typeparam>
		/// <typeparam name="T5">Message type of the port set.</typeparam>
		/// <param name="port">The port set.</param>
		/// <param name="item">The item to be posted.</param>
		/// <param name="exceptionPort">The port where exceptions should be returned.</param>
		/// <param name="coordinationPort">Port that can be used for coordination. If a Port&lt;Ack&gt; is used, an Ack is posted there when the message has been transferred successfully.</param>
		public static void PostWithCausality<T1, T2, T3, T4, T5>(this PortSet<T1, T2, T3, T4, T5> port, T2 item, Port<Exception> exceptionPort, IPort coordinationPort)
		{
			port.P1.PostWithCausality(item, exceptionPort, coordinationPort);
		}

		/// <summary>
		/// Posts a message to the port while using the given exceptionPort as causality.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <typeparam name="T3">Message type of the port set.</typeparam>
		/// <typeparam name="T4">Message type of the port set.</typeparam>
		/// <typeparam name="T5">Message type of the port set.</typeparam>
		/// <param name="port">The port set.</param>
		/// <param name="item">The item to be posted.</param>
		/// <param name="exceptionPort">The port where exceptions should be returned.</param>
		/// <param name="coordinationPort">Port that can be used for coordination. If a Port&lt;Ack&gt; is used, an Ack is posted there when the message has been transferred successfully.</param>
		public static void PostWithCausality<T1, T2, T3, T4, T5>(this PortSet<T1, T2, T3, T4, T5> port, T3 item, Port<Exception> exceptionPort, IPort coordinationPort)
		{
			port.P2.PostWithCausality(item, exceptionPort, coordinationPort);
		}

		/// <summary>
		/// Posts a message to the port while using the given exceptionPort as causality.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <typeparam name="T3">Message type of the port set.</typeparam>
		/// <typeparam name="T4">Message type of the port set.</typeparam>
		/// <typeparam name="T5">Message type of the port set.</typeparam>
		/// <param name="port">The port set.</param>
		/// <param name="item">The item to be posted.</param>
		/// <param name="exceptionPort">The port where exceptions should be returned.</param>
		/// <param name="coordinationPort">Port that can be used for coordination. If a Port&lt;Ack&gt; is used, an Ack is posted there when the message has been transferred successfully.</param>
		public static void PostWithCausality<T1, T2, T3, T4, T5>(this PortSet<T1, T2, T3, T4, T5> port, T4 item, Port<Exception> exceptionPort, IPort coordinationPort)
		{
			port.P3.PostWithCausality(item, exceptionPort, coordinationPort);
		}

		/// <summary>
		/// Posts a message to the port while using the given exceptionPort as causality.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <typeparam name="T3">Message type of the port set.</typeparam>
		/// <typeparam name="T4">Message type of the port set.</typeparam>
		/// <typeparam name="T5">Message type of the port set.</typeparam>
		/// <param name="port">The port set.</param>
		/// <param name="item">The item to be posted.</param>
		/// <param name="exceptionPort">The port where exceptions should be returned.</param>
		/// <param name="coordinationPort">Port that can be used for coordination. If a Port&lt;Ack&gt; is used, an Ack is posted there when the message has been transferred successfully.</param>
		public static void PostWithCausality<T1, T2, T3, T4, T5>(this PortSet<T1, T2, T3, T4, T5> port, T5 item, Port<Exception> exceptionPort, IPort coordinationPort)
		{
			port.P4.PostWithCausality(item, exceptionPort, coordinationPort);
		}

		#endregion

		#region Send (2-5 Ports)
		/// <summary>
		/// If the port is a remote port, this method sends the given item synchronously, meaning the method only 
		/// returns as soon as the item has been transferred successfully. This allows directly catching communication 
		/// errors, and by that ensuring that after this method the item has been transferred correctly.
		/// If the port is a local port, the item will simply be posted as normal.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <param name="port">The port set.</param>
		/// <param name="item">The item to be sent.</param>
		public static void Send<T1, T2>(this PortSet<T1, T2> port, T1 item)
		{
			port.P0.Send(item);
		}

		/// <summary>
		/// If the port is a remote port, this method sends the given item synchronously, meaning the method only 
		/// returns as soon as the item has been transferred successfully. This allows directly catching communication 
		/// errors, and by that ensuring that after this method the item has been transferred correctly.
		/// If the port is a local port, the item will simply be posted as normal.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <param name="port">The port set.</param>
		/// <param name="item">The item to be sent.</param>
		public static void Send<T1, T2>(this PortSet<T1, T2> port, T2 item)
		{
			port.P1.Send(item);
		}

		/// <summary>
		/// If the port is a remote port, this method sends the given item synchronously, meaning the method only 
		/// returns as soon as the item has been transferred successfully. This allows directly catching communication 
		/// errors, and by that ensuring that after this method the item has been transferred correctly.
		/// If the port is a local port, the item will simply be posted as normal.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <typeparam name="T3">Message type of the port set.</typeparam>
		/// <param name="port">The port set.</param>
		/// <param name="item">The item to be sent.</param>
		public static void Send<T1, T2, T3>(this PortSet<T1, T2, T3> port, T1 item)
		{
			port.P0.Send(item);
		}

		/// <summary>
		/// If the port is a remote port, this method sends the given item synchronously, meaning the method only 
		/// returns as soon as the item has been transferred successfully. This allows directly catching communication 
		/// errors, and by that ensuring that after this method the item has been transferred correctly.
		/// If the port is a local port, the item will simply be posted as normal.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <typeparam name="T3">Message type of the port set.</typeparam>
		/// <param name="port">The port set.</param>
		/// <param name="item">The item to be sent.</param>
		public static void Send<T1, T2, T3>(this PortSet<T1, T2, T3> port, T2 item)
		{
			port.P1.Send(item);
		}

		/// <summary>
		/// If the port is a remote port, this method sends the given item synchronously, meaning the method only 
		/// returns as soon as the item has been transferred successfully. This allows directly catching communication 
		/// errors, and by that ensuring that after this method the item has been transferred correctly.
		/// If the port is a local port, the item will simply be posted as normal.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <typeparam name="T3">Message type of the port set.</typeparam>
		/// <param name="port">The port set.</param>
		/// <param name="item">The item to be sent.</param>
		public static void Send<T1, T2, T3>(this PortSet<T1, T2, T3> port, T3 item)
		{
			port.P2.Send(item);
		}

		/// <summary>
		/// If the port is a remote port, this method sends the given item synchronously, meaning the method only 
		/// returns as soon as the item has been transferred successfully. This allows directly catching communication 
		/// errors, and by that ensuring that after this method the item has been transferred correctly.
		/// If the port is a local port, the item will simply be posted as normal.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <typeparam name="T3">Message type of the port set.</typeparam>
		/// <typeparam name="T4">Message type of the port set.</typeparam>
		/// <param name="port">The port set.</param>
		/// <param name="item">The item to be sent.</param>
		public static void Send<T1, T2, T3, T4>(this PortSet<T1, T2, T3, T4> port, T1 item)
		{
			port.P0.Send(item);
		}

		/// <summary>
		/// If the port is a remote port, this method sends the given item synchronously, meaning the method only 
		/// returns as soon as the item has been transferred successfully. This allows directly catching communication 
		/// errors, and by that ensuring that after this method the item has been transferred correctly.
		/// If the port is a local port, the item will simply be posted as normal.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <typeparam name="T3">Message type of the port set.</typeparam>
		/// <typeparam name="T4">Message type of the port set.</typeparam>
		/// <param name="port">The port set.</param>
		/// <param name="item">The item to be sent.</param>
		public static void Send<T1, T2, T3, T4>(this PortSet<T1, T2, T3, T4> port, T2 item)
		{
			port.P1.Send(item);
		}

		/// <summary>
		/// If the port is a remote port, this method sends the given item synchronously, meaning the method only 
		/// returns as soon as the item has been transferred successfully. This allows directly catching communication 
		/// errors, and by that ensuring that after this method the item has been transferred correctly.
		/// If the port is a local port, the item will simply be posted as normal.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <typeparam name="T3">Message type of the port set.</typeparam>
		/// <typeparam name="T4">Message type of the port set.</typeparam>
		/// <param name="port">The port set.</param>
		/// <param name="item">The item to be sent.</param>
		public static void Send<T1, T2, T3, T4>(this PortSet<T1, T2, T3, T4> port, T3 item)
		{
			port.P2.Send(item);
		}

		/// <summary>
		/// If the port is a remote port, this method sends the given item synchronously, meaning the method only 
		/// returns as soon as the item has been transferred successfully. This allows directly catching communication 
		/// errors, and by that ensuring that after this method the item has been transferred correctly.
		/// If the port is a local port, the item will simply be posted as normal.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <typeparam name="T3">Message type of the port set.</typeparam>
		/// <typeparam name="T4">Message type of the port set.</typeparam>
		/// <param name="port">The port set.</param>
		/// <param name="item">The item to be sent.</param>
		public static void Send<T1, T2, T3, T4>(this PortSet<T1, T2, T3, T4> port, T4 item)
		{
			port.P3.Send(item);
		}

		/// <summary>
		/// If the port is a remote port, this method sends the given item synchronously, meaning the method only 
		/// returns as soon as the item has been transferred successfully. This allows directly catching communication 
		/// errors, and by that ensuring that after this method the item has been transferred correctly.
		/// If the port is a local port, the item will simply be posted as normal.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <typeparam name="T3">Message type of the port set.</typeparam>
		/// <typeparam name="T4">Message type of the port set.</typeparam>
		/// <typeparam name="T5">Message type of the port set.</typeparam>
		/// <param name="port">The port set.</param>
		/// <param name="item">The item to be sent.</param>
		public static void Send<T1, T2, T3, T4, T5>(this PortSet<T1, T2, T3, T4, T5> port, T1 item)
		{
			port.P0.Send(item);
		}

		/// <summary>
		/// If the port is a remote port, this method sends the given item synchronously, meaning the method only 
		/// returns as soon as the item has been transferred successfully. This allows directly catching communication 
		/// errors, and by that ensuring that after this method the item has been transferred correctly.
		/// If the port is a local port, the item will simply be posted as normal.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <typeparam name="T3">Message type of the port set.</typeparam>
		/// <typeparam name="T4">Message type of the port set.</typeparam>
		/// <typeparam name="T5">Message type of the port set.</typeparam>
		/// <param name="port">The port set.</param>
		/// <param name="item">The item to be sent.</param>
		public static void Send<T1, T2, T3, T4, T5>(this PortSet<T1, T2, T3, T4, T5> port, T2 item)
		{
			port.P1.Send(item);
		}

		/// <summary>
		/// If the port is a remote port, this method sends the given item synchronously, meaning the method only 
		/// returns as soon as the item has been transferred successfully. This allows directly catching communication 
		/// errors, and by that ensuring that after this method the item has been transferred correctly.
		/// If the port is a local port, the item will simply be posted as normal.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <typeparam name="T3">Message type of the port set.</typeparam>
		/// <typeparam name="T4">Message type of the port set.</typeparam>
		/// <typeparam name="T5">Message type of the port set.</typeparam>
		/// <param name="port">The port set.</param>
		/// <param name="item">The item to be sent.</param>
		public static void Send<T1, T2, T3, T4, T5>(this PortSet<T1, T2, T3, T4, T5> port, T3 item)
		{
			port.P2.Send(item);
		}

		/// <summary>
		/// If the port is a remote port, this method sends the given item synchronously, meaning the method only 
		/// returns as soon as the item has been transferred successfully. This allows directly catching communication 
		/// errors, and by that ensuring that after this method the item has been transferred correctly.
		/// If the port is a local port, the item will simply be posted as normal.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <typeparam name="T3">Message type of the port set.</typeparam>
		/// <typeparam name="T4">Message type of the port set.</typeparam>
		/// <typeparam name="T5">Message type of the port set.</typeparam>
		/// <param name="port">The port set.</param>
		/// <param name="item">The item to be sent.</param>
		public static void Send<T1, T2, T3, T4, T5>(this PortSet<T1, T2, T3, T4, T5> port, T4 item)
		{
			port.P3.Send(item);
		}

		/// <summary>
		/// If the port is a remote port, this method sends the given item synchronously, meaning the method only 
		/// returns as soon as the item has been transferred successfully. This allows directly catching communication 
		/// errors, and by that ensuring that after this method the item has been transferred correctly.
		/// If the port is a local port, the item will simply be posted as normal.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <typeparam name="T3">Message type of the port set.</typeparam>
		/// <typeparam name="T4">Message type of the port set.</typeparam>
		/// <typeparam name="T5">Message type of the port set.</typeparam>
		/// <param name="port">The port set.</param>
		/// <param name="item">The item to be sent.</param>
		public static void Send<T1, T2, T3, T4, T5>(this PortSet<T1, T2, T3, T4, T5> port, T5 item)
		{
			port.P4.Send(item);
		}

		#endregion

		#region SendWithCausality (2-5 Ports)
		/// <summary>
		/// If the port is a remote port, this method sends the given item synchronously, meaning the method only 
		/// returns as soon as the item has been transferred successfully. This allows directly catching communication 
		/// errors, and by that ensuring that after this method the item has been transferred correctly.
		/// If the port is a local port, the item will simply be posted as normal.
		/// The given exceptionPort is used as causality.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <param name="port">The port.</param>
		/// <param name="item">The item to be sent.</param>
		/// <param name="exceptionPort">The port where exceptions should be returned.</param>
		public static void SendWithCausality<T1, T2>(this PortSet<T1, T2> port, T1 item, Port<Exception> exceptionPort)
		{
			port.P0.SendWithCausality(item, exceptionPort);
		}

		/// <summary>
		/// If the port is a remote port, this method sends the given item synchronously, meaning the method only 
		/// returns as soon as the item has been transferred successfully. This allows directly catching communication 
		/// errors, and by that ensuring that after this method the item has been transferred correctly.
		/// If the port is a local port, the item will simply be posted as normal.
		/// The given exceptionPort is used as causality.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <param name="port">The port.</param>
		/// <param name="item">The item to be sent.</param>
		/// <param name="exceptionPort">The port where exceptions should be returned.</param>
		public static void SendWithCausality<T1, T2>(this PortSet<T1, T2> port, T2 item, Port<Exception> exceptionPort)
		{
			port.P1.SendWithCausality(item, exceptionPort);
		}

		/// <summary>
		/// If the port is a remote port, this method sends the given item synchronously, meaning the method only 
		/// returns as soon as the item has been transferred successfully. This allows directly catching communication 
		/// errors, and by that ensuring that after this method the item has been transferred correctly.
		/// If the port is a local port, the item will simply be posted as normal.
		/// The given exceptionPort is used as causality.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <typeparam name="T3">Message type of the port set.</typeparam>
		/// <param name="port">The port.</param>
		/// <param name="item">The item to be sent.</param>
		/// <param name="exceptionPort">The port where exceptions should be returned.</param>
		public static void SendWithCausality<T1, T2, T3>(this PortSet<T1, T2, T3> port, T1 item, Port<Exception> exceptionPort)
		{
			port.P0.SendWithCausality(item, exceptionPort);
		}

		/// <summary>
		/// If the port is a remote port, this method sends the given item synchronously, meaning the method only 
		/// returns as soon as the item has been transferred successfully. This allows directly catching communication 
		/// errors, and by that ensuring that after this method the item has been transferred correctly.
		/// If the port is a local port, the item will simply be posted as normal.
		/// The given exceptionPort is used as causality.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <typeparam name="T3">Message type of the port set.</typeparam>
		/// <param name="port">The port.</param>
		/// <param name="item">The item to be sent.</param>
		/// <param name="exceptionPort">The port where exceptions should be returned.</param>
		public static void SendWithCausality<T1, T2, T3>(this PortSet<T1, T2, T3> port, T2 item, Port<Exception> exceptionPort)
		{
			port.P1.SendWithCausality(item, exceptionPort);
		}

		/// <summary>
		/// If the port is a remote port, this method sends the given item synchronously, meaning the method only 
		/// returns as soon as the item has been transferred successfully. This allows directly catching communication 
		/// errors, and by that ensuring that after this method the item has been transferred correctly.
		/// If the port is a local port, the item will simply be posted as normal.
		/// The given exceptionPort is used as causality.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <typeparam name="T3">Message type of the port set.</typeparam>
		/// <param name="port">The port.</param>
		/// <param name="item">The item to be sent.</param>
		/// <param name="exceptionPort">The port where exceptions should be returned.</param>
		public static void SendWithCausality<T1, T2, T3>(this PortSet<T1, T2, T3> port, T3 item, Port<Exception> exceptionPort)
		{
			port.P2.SendWithCausality(item, exceptionPort);
		}

		/// <summary>
		/// If the port is a remote port, this method sends the given item synchronously, meaning the method only 
		/// returns as soon as the item has been transferred successfully. This allows directly catching communication 
		/// errors, and by that ensuring that after this method the item has been transferred correctly.
		/// If the port is a local port, the item will simply be posted as normal.
		/// The given exceptionPort is used as causality.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <typeparam name="T3">Message type of the port set.</typeparam>
		/// <typeparam name="T4">Message type of the port set.</typeparam>
		/// <param name="port">The port.</param>
		/// <param name="item">The item to be sent.</param>
		/// <param name="exceptionPort">The port where exceptions should be returned.</param>
		public static void SendWithCausality<T1, T2, T3, T4>(this PortSet<T1, T2, T3, T4> port, T1 item, Port<Exception> exceptionPort)
		{
			port.P0.SendWithCausality(item, exceptionPort);
		}

		/// <summary>
		/// If the port is a remote port, this method sends the given item synchronously, meaning the method only 
		/// returns as soon as the item has been transferred successfully. This allows directly catching communication 
		/// errors, and by that ensuring that after this method the item has been transferred correctly.
		/// If the port is a local port, the item will simply be posted as normal.
		/// The given exceptionPort is used as causality.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <typeparam name="T3">Message type of the port set.</typeparam>
		/// <typeparam name="T4">Message type of the port set.</typeparam>
		/// <param name="port">The port.</param>
		/// <param name="item">The item to be sent.</param>
		/// <param name="exceptionPort">The port where exceptions should be returned.</param>
		public static void SendWithCausality<T1, T2, T3, T4>(this PortSet<T1, T2, T3, T4> port, T2 item, Port<Exception> exceptionPort)
		{
			port.P1.SendWithCausality(item, exceptionPort);
		}

		/// <summary>
		/// If the port is a remote port, this method sends the given item synchronously, meaning the method only 
		/// returns as soon as the item has been transferred successfully. This allows directly catching communication 
		/// errors, and by that ensuring that after this method the item has been transferred correctly.
		/// If the port is a local port, the item will simply be posted as normal.
		/// The given exceptionPort is used as causality.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <typeparam name="T3">Message type of the port set.</typeparam>
		/// <typeparam name="T4">Message type of the port set.</typeparam>
		/// <param name="port">The port.</param>
		/// <param name="item">The item to be sent.</param>
		/// <param name="exceptionPort">The port where exceptions should be returned.</param>
		public static void SendWithCausality<T1, T2, T3, T4>(this PortSet<T1, T2, T3, T4> port, T3 item, Port<Exception> exceptionPort)
		{
			port.P2.SendWithCausality(item, exceptionPort);
		}

		/// <summary>
		/// If the port is a remote port, this method sends the given item synchronously, meaning the method only 
		/// returns as soon as the item has been transferred successfully. This allows directly catching communication 
		/// errors, and by that ensuring that after this method the item has been transferred correctly.
		/// If the port is a local port, the item will simply be posted as normal.
		/// The given exceptionPort is used as causality.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <typeparam name="T3">Message type of the port set.</typeparam>
		/// <typeparam name="T4">Message type of the port set.</typeparam>
		/// <param name="port">The port.</param>
		/// <param name="item">The item to be sent.</param>
		/// <param name="exceptionPort">The port where exceptions should be returned.</param>
		public static void SendWithCausality<T1, T2, T3, T4>(this PortSet<T1, T2, T3, T4> port, T4 item, Port<Exception> exceptionPort)
		{
			port.P3.SendWithCausality(item, exceptionPort);
		}

		/// <summary>
		/// If the port is a remote port, this method sends the given item synchronously, meaning the method only 
		/// returns as soon as the item has been transferred successfully. This allows directly catching communication 
		/// errors, and by that ensuring that after this method the item has been transferred correctly.
		/// If the port is a local port, the item will simply be posted as normal.
		/// The given exceptionPort is used as causality.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <typeparam name="T3">Message type of the port set.</typeparam>
		/// <typeparam name="T4">Message type of the port set.</typeparam>
		/// <typeparam name="T5">Message type of the port set.</typeparam>
		/// <param name="port">The port.</param>
		/// <param name="item">The item to be sent.</param>
		/// <param name="exceptionPort">The port where exceptions should be returned.</param>
		public static void SendWithCausality<T1, T2, T3, T4, T5>(this PortSet<T1, T2, T3, T4, T5> port, T1 item, Port<Exception> exceptionPort)
		{
			port.P0.SendWithCausality(item, exceptionPort);
		}

		/// <summary>
		/// If the port is a remote port, this method sends the given item synchronously, meaning the method only 
		/// returns as soon as the item has been transferred successfully. This allows directly catching communication 
		/// errors, and by that ensuring that after this method the item has been transferred correctly.
		/// If the port is a local port, the item will simply be posted as normal.
		/// The given exceptionPort is used as causality.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <typeparam name="T3">Message type of the port set.</typeparam>
		/// <typeparam name="T4">Message type of the port set.</typeparam>
		/// <typeparam name="T5">Message type of the port set.</typeparam>
		/// <param name="port">The port.</param>
		/// <param name="item">The item to be sent.</param>
		/// <param name="exceptionPort">The port where exceptions should be returned.</param>
		public static void SendWithCausality<T1, T2, T3, T4, T5>(this PortSet<T1, T2, T3, T4, T5> port, T2 item, Port<Exception> exceptionPort)
		{
			port.P1.SendWithCausality(item, exceptionPort);
		}

		/// <summary>
		/// If the port is a remote port, this method sends the given item synchronously, meaning the method only 
		/// returns as soon as the item has been transferred successfully. This allows directly catching communication 
		/// errors, and by that ensuring that after this method the item has been transferred correctly.
		/// If the port is a local port, the item will simply be posted as normal.
		/// The given exceptionPort is used as causality.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <typeparam name="T3">Message type of the port set.</typeparam>
		/// <typeparam name="T4">Message type of the port set.</typeparam>
		/// <typeparam name="T5">Message type of the port set.</typeparam>
		/// <param name="port">The port.</param>
		/// <param name="item">The item to be sent.</param>
		/// <param name="exceptionPort">The port where exceptions should be returned.</param>
		public static void SendWithCausality<T1, T2, T3, T4, T5>(this PortSet<T1, T2, T3, T4, T5> port, T3 item, Port<Exception> exceptionPort)
		{
			port.P2.SendWithCausality(item, exceptionPort);
		}

		/// <summary>
		/// If the port is a remote port, this method sends the given item synchronously, meaning the method only 
		/// returns as soon as the item has been transferred successfully. This allows directly catching communication 
		/// errors, and by that ensuring that after this method the item has been transferred correctly.
		/// If the port is a local port, the item will simply be posted as normal.
		/// The given exceptionPort is used as causality.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <typeparam name="T3">Message type of the port set.</typeparam>
		/// <typeparam name="T4">Message type of the port set.</typeparam>
		/// <typeparam name="T5">Message type of the port set.</typeparam>
		/// <param name="port">The port.</param>
		/// <param name="item">The item to be sent.</param>
		/// <param name="exceptionPort">The port where exceptions should be returned.</param>
		public static void SendWithCausality<T1, T2, T3, T4, T5>(this PortSet<T1, T2, T3, T4, T5> port, T4 item, Port<Exception> exceptionPort)
		{
			port.P3.SendWithCausality(item, exceptionPort);
		}

		/// <summary>
		/// If the port is a remote port, this method sends the given item synchronously, meaning the method only 
		/// returns as soon as the item has been transferred successfully. This allows directly catching communication 
		/// errors, and by that ensuring that after this method the item has been transferred correctly.
		/// If the port is a local port, the item will simply be posted as normal.
		/// The given exceptionPort is used as causality.
		/// </summary>
		/// <typeparam name="T1">Message type of the port set.</typeparam>
		/// <typeparam name="T2">Message type of the port set.</typeparam>
		/// <typeparam name="T3">Message type of the port set.</typeparam>
		/// <typeparam name="T4">Message type of the port set.</typeparam>
		/// <typeparam name="T5">Message type of the port set.</typeparam>
		/// <param name="port">The port.</param>
		/// <param name="item">The item to be sent.</param>
		/// <param name="exceptionPort">The port where exceptions should be returned.</param>
		public static void SendWithCausality<T1, T2, T3, T4, T5>(this PortSet<T1, T2, T3, T4, T5> port, T5 item, Port<Exception> exceptionPort)
		{
			port.P4.SendWithCausality(item, exceptionPort);
		}
		#endregion
	}
}
